package com.example.dynamicschedule.task;

import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock;
import com.example.dynamicschedule.dao.CkCreditOutCompanyDataLogMapper;
import com.example.dynamicschedule.dao.CkCreditOutCompanyDataRelationMapper;
import com.example.dynamicschedule.utils.DateUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
public class OneMethodReceiveData {
    static Logger log = Logger.getLogger(OneMethodReceiveData.class);

    @Autowired
    private CkCreditOutCompanyDataLogMapper ckCreditOutCompanyDataLogMapper;
    @Autowired
    private CkCreditOutCompanyDataRelationMapper ckCreditOutCompanyDataRelationMapper;

    @Transactional
    public void receiveOneData() {
        String batchNumber = DateUtils.getOneMethodBatchNumber();
        log.info("---回收一号下发的数据start---batchNumber:" + batchNumber);
        int count = ckCreditOutCompanyDataLogMapper.updateCallbackConfirm(batchNumber);
        int result = ckCreditOutCompanyDataRelationMapper.updateHuishouStatue(batchNumber);
        log.info("---回收一号下发的数据end---batchNumber:" + batchNumber + " count:" + count);
    }
}
